﻿@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <title>Index</title>
    <script src="~/lib/jquery/1.12.4/jquery.min.js"></script>
    <script src="~/lib/bootstrap/3.3.4/js/bootstrap.min.js"></script>
    <link href="~/lib/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet" />
    <link href="~/css/framework-font.css" rel="stylesheet" />
    <link href="~/css/framework-theme.css" rel="stylesheet" />
    <link href="~/lib/select2/select2.min.css" rel="stylesheet" />
    <script src="~/lib/select2/select2.min.js"></script>
    <link href="~/lib/jqgrid/5.3.0/css/ui.jqgrid-bootstrap.css" rel="stylesheet" />
    <script src="~/lib/jqgrid/5.3.0/js/jquery.jqGrid.js"></script>
    <script src="~/lib/jqgrid/5.3.0/i18n/grid.locale-cn.js"></script>

    <link href='~/lib/fullcalendar/packages/core/main.css' rel='stylesheet' />
    <link href='/lib/fullcalendar/packages/bootstrap/main.css' rel='stylesheet' />
    <link href='~/lib/fullcalendar/packages/daygrid/main.css' rel='stylesheet' />
    <link href='~/lib/fullcalendar/packages/timegrid/main.css' rel='stylesheet' />
    <link href='~/lib/fullcalendar/packages/list/main.css' rel='stylesheet' />
    <script src='~/lib/fullcalendar/packages/core/main.js'></script>
    <script src='~/lib/fullcalendar/packages/interaction/main.js'></script>
    <script src='~/lib/fullcalendar/packages/bootstrap/main.js'></script>
    <script src='~/lib/fullcalendar/packages/daygrid/main.js'></script>
    <script src='~/lib/fullcalendar/packages/timegrid/main.js'></script>
    <script src='~/lib/fullcalendar/packages/list/main.js'></script>
    <script src='~/lib/fullcalendar/packages/core/locales/zh-cn.js'></script>

    <link href="~/css/framework-ui.css" rel="stylesheet" />
    <script src="~/js/framework-ui.js"></script>
    <style>

        html, body {
            overflow: hidden; /* don't do scrollbars */
            font-family: Arial, Helvetica Neue, Helvetica, sans-serif;
            font-size: 14px;
        }

        #calendar-container {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
        }

        .fc-header-toolbar {
            /*
        the calendar will be butting up against the edges,
        but let's scoot in the header's buttons
        */
            padding-top: 1em;
            padding-left: 1em;
            padding-right: 1em;
        }
    </style>
    <script>
        document.addEventListener('DOMContentLoaded', function () {
            var calendarEl = document.getElementById('calendar');

            var calendar = new FullCalendar.Calendar(calendarEl, {
                locale: 'zh-cn',
                plugins: ['bootstrap', 'interaction', 'dayGrid', 'timeGrid', 'list'],
                height: 'parent',
                header: {
                    left: 'prev,next today',
                    center: 'title',
                    right: 'dayGridMonth,timeGridWeek,timeGridDay,listWeek'
                },
                defaultView: 'dayGridMonth',
                defaultDate: '2019-04-12',
                navLinks: true, // can click day/week names to navigate views
                selectable: true,
                selectMirror: true,
                select: function (arg) {
                    //var title = prompt('Event Title:');
                    //if (title) {
                    //    calendar.addEvent({
                    //        title: title,
                    //        start: arg.start,
                    //        end: arg.end,
                    //        allDay: arg.allDay
                    //    })
                    //}
                    //calendar.unselect()
                    $.modalOpen({
                        id: "Form",
                        title: "新增菜单",
                        url: "/OAManage/Schedule/Form",
                        width: "600px",
                        height: "400px",
                        callBack: function (iframeId) {
                            top.frames[iframeId].submitForm();
                        }
                    });
                },
                eventClick: function (info) {
                    console.log(info);
                    alert('Id: ' + info.event.id);
                    alert('Event: ' + info.event.title);
                    alert('Coordinates: ' + info.jsEvent.pageX + ',' + info.jsEvent.pageY);
                    alert('View: ' + info.view.type);

                    // change the border color just for fun
                    info.el.style.borderColor = 'red';
                },
                editable: true,
                eventLimit: true, // allow "more" link when too many events
                events: [
                    {
                        id:711,
                        title: 'All Day Event',
                        start: '2019-04-01',
                    },
                    {
                        id: 712,
                        title: 'Long Event',
                        start: '2019-04-07',
                        end: '2019-04-10'
                    },
                    {
                        id: 713,
                        groupId: 999,
                        title: 'Repeating Event',
                        start: '2019-04-09T16:00:00'
                    },
                    {
                        id: 714,
                        groupId: 999,
                        title: 'Repeating Event',
                        start: '2019-04-16T16:00:00'
                    },
                    {
                        id: 715,
                        title: 'Conference',
                        start: '2019-04-11',
                        end: '2019-04-13'
                    },
                    {
                        id: 716,
                        title: 'Meeting',
                        start: '2019-04-12T10:30:00',
                        end: '2019-04-12T12:30:00'
                    },
                    {
                        id: 717,
                        title: 'Lunch',
                        start: '2019-04-12T12:00:00'
                    },
                    {
                        id: 718,
                        title: 'Meeting',
                        start: '2019-04-12T14:30:00'
                    },
                    {
                        id: 719,
                        title: 'Happy Hour',
                        start: '2019-04-12T17:30:00'
                    },
                    {
                        id: 720,
                        title: 'Dinner',
                        start: '2019-04-12T20:00:00'
                    },
                    {
                        id: 721,
                        title: 'Birthday Party',
                        start: '2019-04-13T07:00:00'
                    },
                    {
                        id: 722,
                        title: 'Click for Google',
                        url: 'http://google.com/',
                        start: '2019-04-28'
                    }
                ]
            });

            calendar.render();
        });
    </script>
</head>
<body>
    <div id='calendar-container'>
        <div id='calendar'></div>
    </div>
</body>
</html>
